unit frmyesno;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  Buttons, StdCtrls, ButtonPanel;

type

  { TFormYesNo }

  TFormYesNo = class(TForm)
    btnPanel: TButtonPanel;
    Label1: TLabel;
    procedure CancelButtonClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure OKButtonClick(Sender: TObject);
  private
    { private declarations }
    function SetYesNoValue: boolean;
  public
    { public declarations }
    property isYesNo: boolean read SetYesNoValue;
  end; 

var
  FormYesNo: TFormYesNo;
  YesNoValue: boolean;

implementation

{ TFormYesNo }

procedure TFormYesNo.CancelButtonClick(Sender: TObject);
begin
  YesNoValue:=FALSE;
  SetYesNoValue;
end;

procedure TFormYesNo.FormCreate(Sender: TObject);
begin
  btnPanel.OKButton.OnClick:=@OKButtonClick;
  btnPanel.CancelButton.OnClick:=@CancelButtonClick;
  btnPanel.HelpButton.OnClick:=@HelpButtonClick;
end;

procedure TFormYesNo.OKButtonClick(Sender: TObject);
begin
  YesNoValue:=TRUE;
  SetYesNoValue;
end;

function  TFormYesNo.SetYesNoValue: boolean;
begin
  result:=YesNoValue;
end;
initialization
  {$I frmyesno.lrs}

end.

